function login(){
    var userName = $("#userName").val();
    var passWord = $("#passWord").val();
    if(userName == ''){
        alert("请输入用户名!");
        return;
    }
    if(passWord == ''){
        alert("请输入密码!");
        return;
    }

    var data = "user_name="+userName+"&user_pass="+passWord;
    $.ajax({
        type: "get",
        url: python_url+'/api/v1/login/',
        async:false,
        cache:false,
        data:data,
        dataType:'json',
        success:function(data){
            if(data.success==true){
                setTokenId(data.data.token_id);
                window.location.href="/beetle/App/main.html";
            }else{
                alert(data.msg);
            }
        }
    });
}